const koa = require("koa");
const app = new koa();
const cors=require('koa-cors');
const router = require('koa-router')();

const findRouter=require('./routers/find')
// const mainRouter=require('./routers/index')
const citiesRouter=require('./routers/cities')
const localRouter=require('./routers/local')
const goodsRouter = require('./routers/goods')
// const videosRouter=require('./routers/videos')
// const rankingRouter=require('./routers/ranking')
// const transferRouter=require('./routers/transfer')

// 挂载跨域中间件 先跨域访问(放在路由前)
app.use(cors())// 允许什么方法跨域
router.use('/find',findRouter)
// app.use(mainRouter);
router.use('/cities',citiesRouter);
router.use('/local',localRouter);
router.use('/goodstuff' ,goodsRouter)
// router.use('/ranking',rankingRouter);
// router.use('/transfer',transferRouter);
app.use(router.routes())

app.listen(3033, () => {
    console.log("Your app is running");
})